/*
 *  $Id: Damage.cs 898 2009-11-28 16:12:26Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Affects {
    /// <summary>
    /// Эффект: событие получения урона
    /// Параметры: обработчик события и выборка событий
    /// </summary>
    public class OnDamage: Event<DamageEvent> {
        public OnDamage(DamageEvent handler, AffectSummaryType sumTypes): base(handler, sumTypes) {}

        public override string Id {
            get { return "event.damage"; }
        }

        public override Affect Clone() {
            return new OnDamage(Handler, SumTypes);
        }

        public override void SetEvent(AffectSummary summary) {
            summary.OnAfterDamage += Handler;
        }
        public override void ResetEvent(AffectSummary summary) {
            summary.OnAfterDamage -= Handler;
        }
    }
}